import type { AppRouteModule } from '/@/router/types'
import { RoleEnum } from '/@/enums/roleEnum'
import { LAYOUT } from '/@/router/constant'
import { t } from '/@/hooks/web/useI18n'

const dashboard: AppRouteModule = {
  path: '/dashboard',
  name: 'Dashboard',
  component: LAYOUT,
  redirect: '/dashboard/home',
  meta: {
    orderNo: 10,
    icon: 'ion:grid-outline',
    title: t('routes.dashboard.dashboard'),
    roles: [RoleEnum.SUPER],
  },
  children: [
    {
      path: 'home',
      name: 'HomePage',
      component: () => import('/@/views/dashboard/home/index.vue'),
      meta: {
        affix: true,
        title: t('routes.dashboard.home'),
      },
    },
    {
      path: 'productSet',
      name: 'ProductSet',
      component: () => import('/@/views/dashboard/productSet/index.vue'),
      meta: {
        title: t('routes.dashboard.productSet'),
      },
    },
    {
      path: 'profile',
      name: 'Profile',
      component: () => import('/@/views/dashboard/productSet/profile.vue'),
      meta: {
        title: t('routes.dashboard.profile'),
        hideMenu: true,
      },
    },
    {
      path: 'guide',
      name: 'Guide',
      component: () => import('/@/views/dashboard/productSet/guide.vue'),
      meta: {
        title: t('routes.dashboard.guide'),
        hideMenu: true,
      },
    },
    {
      path: 'freeControl',
      name: 'FreeControl',
      component: () => import('/@/views/dashboard/freeControl/index.vue'),
      meta: {
        title: t('routes.dashboard.freeControl'),
      },
    },
    {
      path: 'web',
      name: 'web',
      component: () => import('/@/views/dashboard/web/index.vue'),
      meta: {
        title: t('routes.dashboard.web'),
      },
    },
    {
      path: 'softwarePrice',
      name: 'SoftwarePrice',
      component: () => import('/@/views/dashboard/softwarePrice/index.vue'),
      meta: {
        title: t('routes.dashboard.price'),
      },
    },
    {
      path: 'instructions',
      name: 'Instructions',
      component: () => import('/@/views/dashboard/instructions/index.vue'),
      meta: {
        title: t('routes.dashboard.notice'),
      },
    },

    {
      path: 'settle',
      name: 'Settle',
      component: () => import('/@/views/dashboard/settle/index.vue'),
      meta: {
        title: t('routes.dashboard.commission'),
      },
    },
  ],
}

export default dashboard
